let vm = new Vue({
    el: '.main-content',
    data: {
        statute: {},
        ueditorConfig: {
            UEDITOR_HOME_URL: "static/ueditor/",     //富文本编辑器的资源加载路径  是拼接路径
            maximumWords: 100000,                     //替代原默认值 设置允许最大字符数
            //服务器统一处理富文本的接口 当第一次初始化富文本的时候，一定会自动发送一个ajax请求到统一请求接口
            //并且带上参数action=config 获取后台服务器的配置json数据
            // 通过action=xxx来区分是属于哪种操作
            serverUrl: 'doUeditor'
        },
        // description: '<h2><img src="http://img.baidu.com/hi/jx2/j_0003.gif"/>Vue + UEditor + v-model双向绑定</h2>'
    },
    methods: {
        doUpdate: function () {
            axios({
                url: "mapper/statute/doUpdate",
                method: "post",
                data: this.statute
            }).then(response => {
                if (response.data.success) {
                    parent.layer.success=response.data.success;
                    let index = parent.layer.getFrameIndex(window.name);//根据当前窗体名字获取其索引值
                    console.log(index);
                    parent.layer.close(index);
                }else {
                    layer.msg(response.data.msg)
                }
            }).catch(error => {
                layer.msg(error.message)
            })
        }
    },
    created: function () {
        this.statute = parent.layer.obj;
    },
    mounted:function(){
        jeDate({
            dateCell: "#modifydate",
            format:'YYYY-MM-DD',
            zIndex:99999999,
            choosefun:(val)=>{
                console.log(val);
                this.statute.pubDate=val;
            }
        });
    },
    components:{
        VueUeditorWrap
    }

});